<?PHP
  $database=pg_connect("host=<HOST> port=5432 dbname=<DB NAME> user=<USER> password=<PASSWORD>" );
    if(!$database)
    {
    	die("AGFX:Could not connect -> " . pg_errormessage($database));
    }

  ////http://monkey.intelligentdevelopment.sk/games/cubes_games_score_list.php
  
  $result = pg_query($database,"SELECT \"GAME\",\"PLAYER\", \"SCORE\" FROM <TABLENAME>" );
  
  if (!$result)
  {
    echo "AGFX: An error occured.\n";
    exit;
  }

  $i = 1;
  while($row = pg_fetch_array( $result,NULL, PGSQL_NUM) )
  {
    //printf( "<tr><td>%d.</td><td>%s</td><td>%s</td><td>%d</td></tr>", $i, $row[0], $row[1], $row[2] );
    printf( "%d;%s;%s;%d|", $i, $row[0], $row[1], $row[2] );
    $i++;
  }
  @pg_free_result($result);
?>